package com.wman.Mvc;

import android.os.Bundle;

import com.wman.R;
import com.wman.data.DataCenter;

import java.util.List;

import androidx.appcompat.app.AppCompatActivity;

/**
 * 主流上理解的MVP是在代码结构上对C进行了拆分
 * MVC 同样可以分开
 */
public class MvcActivity extends AppCompatActivity {

    IView mDataView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mvc);

        mDataView = findViewById(R.id.data_view);

        List<String> data = DataCenter.getData();
        mDataView.showData(data.get(0), data.get(1));
    }

    interface IView {
        void showData(String str1, String str2);
    }
}
